BEGIN;
/*先执行S锁，其他会话再执行X锁查询，则会阻塞X锁*/
SELECT first_name FROM lock_test.`actor` LOCK IN SHARE MODE;
/*提交事务，结束S锁*/
COMMIT;


/*--------------------------------------------------------------*/
BEGIN;
/*先执行S锁，其他会话再执行X锁查询，则会阻塞X锁*/
SELECT first_name FROM lock_test.`actor` LOCK IN SHARE MODE;

/*提交事务，结束S锁*/
COMMIT;


/*--------------------------------------------------------------*/